<style>
    .control-label{
        width: 220px;
    }

</style>
<div class="row animated fadeInRight">
    <div class="col-md-4">
        <div class="box box-success">
            <div class="panel-heading">
                订单信息
            </div>
            <div class="panel-body">

                <form id="update-form" role="form" data-toggle="validator" method="POST" action="">
                    <div class="box-body box-profile">
                        <h3 class="profile-username text-center">{$data.status_text}</h3>
                        <!--<h6 class="profile-username text-center">{$data.order_no}</h3>-->

                        <p class="text-muted text-center">酬金:{$data.task_price}</p>
                        <div class="form-group">
                            <label class="control-label">{:__('Task_no')}:{$data.task_no} <a href="{:url('task/detail',['ids'=>$data['task_id']])}">查看任务详情></a></label>
                            <label class="control-label control-label1">{:__('Task_title')}:{$data.task_title}</label>
                        </div>
                        <div class="form-group">
                            <label class="control-label">{:__('Order_no')}:{$data.order_no}</label>

                            <label class="control-label control-label1">{:__('Phone')}:{$data.phone}</label>
                        </div>
                        <div class="form-group">
                            <label class="control-label">{:__('Position_name')}:{$data.position_name}</label>

                            <label class="control-label control-label1">{:__('Createtime')}:{$data.createtime|date="Y-m-d h:i:s",###}</label>
                        </div>
                        <hr/>
                        <div class="form-group">
                            <label class="control-label">{:__('Brand_name')}:{$car_info.brand_name}</label>

                            <label class="control-label control-label1">{:__('Type_name')}:{$car_info.type_name}</label>
                        </div>
                        <div class="form-group">
                            <label class="control-label">{:__('Color_name')}:{$car_info.color_name}</label>

                            <label class="control-label control-label1">{:__('City')}:{$car_info.province}-{$car_info.city}-{$car_info.area}</label>
                        </div>


                    </div>
                </form>
            </div>
        </div>

    </div>
    <div class="col-md-8">
        <div class="panel panel-default panel-intro panel-nav">
            <div class="panel-heading">
                <ul class="nav nav-tabs">
                    <li class="active"><a href="#one" data-toggle="tab"><i class="fa fa-list"></i> 任务进度</a></li>
                </ul>
            </div>
            <div class="panel-body">
                <div id="myTabContent" class="tab-content">
                    <div class="tab-pane fade active in" id="one">
                        <div class="widget-body no-padding">

                            <table id="table" class="table table-striped table-bordered table-hover" width="100%">
                                {volist name="list" id="vo"}

                                <tr>
                                    <td style="font-size: 16px;">
                                        {if condition="$vo.status!=0"}
                                        ({$vo.tempo_num}/{$data.show_time})任务进度审核:({$vo.updatetime|date="Y-m-d h:i:s",###},{if condition="$vo.status==10"}已通过{/if}{if condition="$vo.status==20"}已拒绝,拒绝原因:{$vo.refusal_reason}{/if})
                                        {else/}
                                        上刊待审核
                                        {/if}
                                        <br/>
                                        {volist name="vo.img_list" id="row"}
                                        <img src="__CDN__{$row}" width="100px" height="100px">
                                        {/volist}
                                        {if condition="$vo.status==0"}
                                        <a class="text-success btn-check"  style="cursor:pointer" data-url="order/checkok" data-id="{$vo.tempo_id}"><b>通过</b></a>
                                        <a class="text-error btn-checkcancel"  style="cursor:pointer" data-url="order/checkcancel" data-id="{$vo.tempo_id}"><b>拒绝</b></a>
                                        {/if}
                                        <br/>
                                        {$vo.createtime|date="Y-m-d h:i:s",###}
                                    </td>
                                </tr>
                                {/volist}

                            </table>

                        </div>
                    </div>

                </div>
            </div>
        </div>

    </div>
</div>
<script src="__CDN__/html/js/jquery.min.js" type="text/javascript"></script>
<script>
    $('.btn-check').on("click", function (e) {
        e.preventDefault();
        var id = $(this).data("id");
        var that = this;
        var url = $(that).data("url");
        Layer.confirm(
                __('确定通过上刊审核吗？'),
                {icon: 3, title: __('确定通过上刊审核吗？'), shadeClose: true},
                function (index) {
                    $.post(url, {tempo_id: id}, function (res) {
                        window.location.reload();
                    });
                    Layer.close(index);
                }
        );
    });
    $('.btn-checkcancel').on("click", function (e) {
        e.preventDefault();
        var id = $(this).data("id");
        var that = this;
        var url = $(that).data("url");
        Layer.prompt({title: __('拒绝原因'), formType: 0}, function (value, index) {
            Backend.api.ajax({
                url: url + "?tempo_id=" + id + "&refusal_reason=" + value,
                data: $(that).closest("form").serialize()
            }, function () {
                 window.location.reload();
            });

            Layer.close(index);
        });
    });
</script>
